﻿using System.Configuration;
using System.Threading.Tasks;

namespace Partner.Surround.MinIO.Services
{
    public class MinIOService : IMinIOService
    {
        private readonly Configuration _configuration;
        private readonly MinIOManager _minIOManager;

        public MinIOService(Configuration configuration)
        {
            _configuration = configuration;
            _minIOManager = new MinIOManager(_configuration);
        }

        public async Task<string> GetFileUrlAsync(string bucketName, string objectName, int expiresInt = 604800)
        {
            return await _minIOManager.GetFileUrlAsync(bucketName, objectName, expiresInt);
        }

        public async Task UploadFile(string objectName, string filePath, string contentType, string bucketName = "default", string location = "us-east-1")
        {
            await _minIOManager.UploadFile(objectName, filePath, contentType, bucketName, location);
        }
    }
}
